/**
 * 表单数据封装
 */
(function ($) {
    $.extend({
        form: {
            /**
             * 获取表单中的字段值
             * @param fieldName
             */
            getField: function (formArray) {
                return this.formatMap(formArray);
            },
            formatMap: function (formArray) {
                var data = {};
                formArray.forEach(function (value, index) {
                    data[value.name] = value.value;
                });
                return data;
            }
        }
    });
})(jQuery);